# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2021/10/27 18:33
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : sharp_im3.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from PIL import Image
from PIL.ImageFilter import FIND_EDGES, EDGE_ENHANCE, EDGE_ENHANCE_MORE, SHARPEN
from DIP_experiment_5.util import contrast_show

# 以灰度图形式读入图像
im_path = "../experiment_fig/beans.png"
im = Image.open(im_path)
find_edge_im = im.filter(FIND_EDGES)
edge_enhance_im = im.filter(EDGE_ENHANCE)
edge_enhance_more_im = im.filter(EDGE_ENHANCE_MORE)
sharpen_im = im.filter(SHARPEN)
im_dict = {"find_edge_im": find_edge_im, "edge_enhance_im": edge_enhance_im,
           "edge_enhance_more_im": edge_enhance_more_im, "sharpen_im": sharpen_im}

contrast_show(im_dict, (2, 2), hspace=0.4)
